
        %if html_fields:

            %for k,v in sorted(html_fields.items(), key=lambda x:x[1].get('idx')):

            %if v.get('type') == 'text':
                <div class="control-group" style="border:1px solid #e0e0e0; padding:5px;">
                <label>
                ■${v.get('title')}
                </label>
                <div class="controls">
                <input type="text" id="${k}" name="${k}" class="input-xlarge" style="width:95%;" value="${v.get('string')}">
                <br>
                %if post:
                ${"$"}${"{"}${"AT.GetPaneoField('post','%s','%s')"%(post.slug,v.get('name'))}${"}"} 
                %else:
                ${"$"}${"{"}${"AT.GetPaneoField('page','%s','%s')"%(id,v.get('name'))}${"}"} 
                %endif
                </div>
                </div>
            %endif

            %if v.get('type') == 'textarea':
                <div class="control-group" style="border:1px solid #e0e0e0; padding:5px;">
                <label>
                ■${v.get('title')}
                </label>
                <div class="controls">
                <textarea id="${k}" name="${k}" class="wysi input-xlarge" style="width:95%;">${v.get('string')|h}</textarea>
                %if post:
                ${"$"}${"{"}${"AT.GetPaneoField('post','%s','%s')"%(post.slug,v.get('name'))}${"}"} 
                %else:
                ${"$"}${"{"}${"AT.GetPaneoField('page','%s','%s')"%(id,v.get('name'))}${"}"} 
                %endif
                <br>
                </div>
                </div>
            %endif


            %if v.get('type') == 'text-link':
            <div class="control-group" style="border:1px solid #e0e0e0; padding:5px;">
            <label>
            ■${v.get('title')} [${v.get('name')}]
            </label>
            <div class="controls">
            <div>リンク文書<br>
            <input type="text" id="${k}" name="${k}" class="input-xlarge" style="width:95%;" value="${v.get('string')}">
            %if post:
            ${"$"}${"{"}${"AT.GetPaneoField('post','%s','%s')"%(post.slug,v.get('name'))}${"}"} 
            %else:
            ${"$"}${"{"}${"AT.GetPaneoField('page','%s','%s')"%(id,v.get('name'))}${"}"} 
            %endif
            </div>
            <div>リンクURL<br>
            <input type="text" id="${k}_href" name="${k}_href" class="input-xlarge" style="width:95%;" value="${v.get('ext',{}).get('href')}">
            %if post:
            ${"$"}${"{"}${"AT.GetPaneoField('post','%s','%s','href')"%(post.slug,v.get('name'))}${"}"} 
            %else:
            ${"$"}${"{"}${"AT.GetPaneoField('page','%s','%s','href')"%(id,v.get('name'))}${"}"} 
            %endif
            </div>
            </div>
            %endif
    
            %endfor

        %endif

